package cn.sc.allinpay.allfavour.business.setmanage;

import android.os.Bundle;
import android.support.v7.widget.AppCompatEditText;
import android.support.v7.widget.AppCompatTextView;
import android.view.View;

import butterknife.BindView;
import butterknife.OnClick;
import cn.sc.allinpay.allfavour.R;
import cn.sc.allinpay.allfavour.base.activity.BaseActivity;

/**
 * 管理员密码修改
 */
public class SetManageActivity extends BaseActivity<SetManageContract.View, SetManageContract.Presenter> implements SetManageContract.View {

    @BindView(R.id.tvName)
    AppCompatTextView tvName;
    @BindView(R.id.etOriPwd)
    AppCompatEditText etOriPwd;
    @BindView(R.id.etNewPwd)
    AppCompatEditText etNewPwd;
    @BindView(R.id.etCfmPwd)
    AppCompatEditText etCfmPwd;

    @Override
    protected int layoutId() {
        return R.layout.activity_set_pwd;
    }

    @Override
    protected void layoutTitle(View top, AppCompatTextView left, AppCompatTextView title, AppCompatTextView right) {
        title.setText("管理员密码修改");
    }

    @Override
    protected SetManageContract.Presenter bindPresenter() {
        return new SetManagePresenter();
    }

    @Override
    protected void layoutContent(Bundle savedInstanceState) {

    }

    @OnClick(R.id.btnConfirm)
    void clickConfirm() {
        presenter.reqLoginPwdModify();
    }

    @Override
    public void showName(String data) {
        tvName.setText(data);
    }

    @Override
    public String getOriPwd() {
        return etOriPwd.getText().toString().trim();
    }

    @Override
    public String getNewPwd() {
        return etNewPwd.getText().toString().trim();
    }

    @Override
    public String getCfmPwd() {
        return etCfmPwd.getText().toString().trim();
    }
}

